package com.ktjiaoyu.ktmall.dao;

import com.ktjiaoyu.ktmall.entity.Product;
import com.ktjiaoyu.ktmall.utils.Page;

import java.sql.SQLException;
import java.util.List;

public interface ProductDao {
    /**
     * 分页查询
     * */
        List<Product> findList(String title,Long categoryId, int pageNo, int pageSize) throws SQLException;
    /**
     * 获取总记录数
     * */
    int count (String title,Long categoryId) throws SQLException;

    /**
     * 新增商品
     * */
    int insert(Product entity) throws SQLException;
    /**
     * 修改商品
     * */
    int update(Product entity) throws SQLException;

    /**
     * 根据Id查询商品
     * */
    Product findById(Long id) throws SQLException;


    /**
     * 删除商品
     * */
    int delete(Long id) throws SQLException;

    /**
     * 修改商品状态
     * */
    int updateStatus(Long id,Integer status) throws SQLException;
}
